Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-annotation

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-annotation

Annotation parser for CSS

  • 0.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
360
decreased by-22.25%
Maintainers
1
Weekly downloads
 
Created
Source

css-annotation Build Status

Annotation parser for CSS

Installation

$ npm install css-annotation

Example

input.css:

/*
 * @foo foofoo
 * @bar bar bar bar
 */

@media screen (min-width: 600px) {
  /*
   * @hoge
   */
  .class {
    /*
     * @baz baz1, baz2, baz3
     */
     font-size: 12px;
  }
}
var fs = require('fs')
var annotation = require('./')

var css = fs.readFileSync('input.css', 'utf-8').trim()

annotation.parse(css)
/*
[
  {
    foo: 'foofoo',
    bar: 'bar bar bar'
  },
  {
    atrule: 'media',
    hoge: true,
    params: 'screen (min-width: 600px)'
  },
  {
    baz: ['baz1', 'baz2', 'baz3']
    rule: '.class'
  }
]
*/

API

annotation.parse(css)

Parse annotation comment in css and return array of its results.

annotation.read(commentText)

commentText is PostCSS's comment.text.

Return its parse results.

License

The MIT License (MIT)

Copyright (c) 2014 Masaaki Morishita

Keywords

FAQs

Package last updated on 08 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc